package com.skillworld.webapp.model.user;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import com.skillworld.webapp.model.user.User;

@Entity
@Table(name="userranking")
public class UserRanking {

    private Long userRankingId;
    private Date date;
    private User userId1;
    private User userId2;
    private User userId3;
    private User userId4;
    private User userId5;
    
    public UserRanking(){
        
    }
            
    public UserRanking(Date date, User userId1,
            User userId2, User userId3, User userId4, User userId5) {
        
        this.date = date;
        this.userId1 = userId1;
        this.userId2 = userId2;
        this.userId3 = userId3;
        this.userId4 = userId4;
        this.userId5 = userId5;
    }

    @SequenceGenerator(name="UserRankingIdGenerator",sequenceName="UserRankingSeq")
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO,generator="UserRankingIdGenerator")
    @Column(name="idRankingU")
    public Long getUserRankingId() {
        return userRankingId;
    }

    public void setUserRankingId(Long userRankingId) {
        this.userRankingId = userRankingId;
    }

    @Column(name = "date")
    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="idUser1")
    public User getUserId1() {
        return userId1;
    }

    public void setUserId1(User userId1) {
        this.userId1 = userId1;
    }

    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="idUser2")
    public User getUserId2() {
        return userId2;
    }

    public void setUserId2(User userId2) {
        this.userId2 = userId2;
    }

    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="idUser3")
    public User getUserId3() {
        return userId3;
    }

    public void setUserId3(User userId3) {
        this.userId3 = userId3;
    }

    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="idUser4")
    public User getUserId4() {
        return userId4;
    }

    public void setUserId4(User userId4) {
        this.userId4 = userId4;
    }

    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="idUser5")
    public User getUserId5() {
        return userId5;
    }

    public void setUserId5(User userId5) {
        this.userId5 = userId5;
    }
    
}
